﻿@{
    ViewBag.Title = "יצירת פרויקט חדש";
}
@section headElements{
    <link href="@Url.Content("~/Content/AlbumDetails.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/AlbumSectionsList.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/AddAlbum.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/AlbumSectionsList.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/FilmingDaysList.js")" type="text/javascript"></script>
}
<ul id="Breadcrumbs">
    <li><a href="@Url.Action("Index", "Admin")">פאנל ניהול</a></li>
    <li><a href="@Url.Action("Index", "Albums")">פרויקטים</a></li>
    <li>@ViewBag.Title</li>
</ul>
@using (Html.BeginForm("Add", "Albums", FormMethod.Post, new { id = "frmAddAlbum" }))
{
    <div id="divAlbumForm">
        <div id="divAlbumDetails" class="floatRight highlightedPanel">
            <div class="title">
                פרטי אלבום</div>
            <div class="fieldRow">
                <div class="label">
                    שם האלבום
                </div>
                <div class="value">
                    @Html.TextBox("Title", "", new { maxlength = "60" })
                </div>
            </div>
            <div class="topSpace">
            </div>
            <div class="fieldRow">
                <div class="label">
                    מספר עמודים</div>
                <div class="value">
                    @Html.TextBox("NumOfPages", "2", new { @class = "narrowTextbox", type = "number", min = "2", max = "1000", step = "2" })
                </div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    מספר עותקים</div>
                <div class="value">
                    @Html.TextBox("NumOfCopies", null, new { @class = "narrowTextbox", type = "number", min = "0" })</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    מספר הזמנה</div>
                <div class="value">
                    @Html.TextBox("OrderNum") <span id="orderNumExists">מספר הזמנה זה כבר קיים</span>
                </div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    סוג אלבום</div>
                <div class="value">
                    @Html.DropDownList("AlbumSizeId", (ViewBag.AlbumSizesList as SelectList), "--בחר--")</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    סוג נייר</div>
                <div class="value">
                    @Html.DropDownList("PaperId", (ViewBag.PapersList as SelectList), "--בחר--")</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    תאריך לסיום</div>
                <div class="value">
                    @Html.TextBox("DueDate", null, new { @class = "dateTextbox" })</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    חד צדדי</div>
                <div class="value">
                    @Html.CheckBox("IsOneSided")
                    <label for="IsOneSided">
                        אלבום חד צדדי</label></div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    צלם</div>
                <div class="value">
                    @Html.CheckBox("HasPhotographer")
                    <label for="HasPhotographer">
                        כולל צלם</label></div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    גרפיקה</div>
                <div class="value">
                    @Html.CheckBox("IncludeGraphics")
                    <label for="IncludeGraphics">
                        כולל גרפיקה</label></div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    מספר עמודים שמורים בתחילת כיתה
                </div>
                <div class="value">
                    @Html.TextBox("IntroPagesNumber", "0", new { @class = "narrowTextbox", type = "number", min = "0" })</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    איש מכירות
                </div>
                <div class="value">
                    @Html.DropDownList("SalesManId", (ViewBag.SalesMen as List<SelectListItem>), "--אין--")
                </div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    הערות סטודיו</div>
                <div class="value">
                    @Html.TextArea("StudioNotes", new { cols = "40", rows = "5" })</div>
                <div class="clear">
                </div>
            </div>
        </div>
        <div id="divEditorDetails" class="floatRight rightSpace highlightedPanel">
            <div class="title">
                פרטי עורך אלבום</div>
            <div class="fieldRow">
                <div class="label">
                    סיסמת עורך</div>
                <div class="value">
                    @Html.TextBox("EditorPassword", Guid.NewGuid().ToString().Substring(0, 5))</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    אימייל עורך</div>
                <div class="value">
                    @Html.TextBox("EditorEmail")</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    שם עורך</div>
                <div class="value">
                    @Html.TextBox("EditorFirstName", null, new { @class = "nameTextbox" })
                    @Html.TextBox("EditorLastName", null, new { @class = "nameTextbox" })</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    טלפון</div>
                <div class="value">
                    @Html.TextBox("EditorPhone")</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                    טלפון נייד</div>
                <div class="value">
                    @Html.TextBox("EditorMobile")</div>
                <div class="clear">
                </div>
            </div>
        </div>
        <div class="clear">
        </div>
    </div>
    <div class="clear topSpace">
    </div>
    <div class="highlightedPanel">
        <div class="title">
            מקטעים
        </div>
        <ul id="Sections">
        </ul>
        <div class="clear">
            <input type="button" id="btnAddSection" value="הוסף מקטע" class="button" />
        </div>
    </div>
    <div class="clear topSpace">
    </div>
    <div class="highlightedPanel">
        <div class="title">
            ימי צילום
        </div>
        <table id="FilmingDays" class="hidden">
            <tr>
                <th>
                    תאריך
                </th>
                <th>
                    צלם
                </th>
                <th>
                    הסר
                </th>
            </tr>
        </table>
        <div class="clear topSpace">
            <input type="button" id="btnAddFilmingDay" value="הוסף יום צילום" class="button" />
        </div>
    </div>
    <div class="clear topSpace">
        <input type="submit" value="אישור" class="button big" />
        <div id="pagesCountNotEqual" class="errorMessage hidden">
            שים לב! מספר העמודים באלבום לא תואם לסך העמודים במקטעים.
        </div>
    </div>
}
<script id="sectionRowTemplate" type="text/x-jquery-tmpl">
    <li>
        <div class="floatRight">
            <div class="fieldRow">
                <div class="label">
                   כותרת</div>
                <div class="value">
                    <input type="text" name="SectionTitle" /></div>
            </div>
            <div class="fieldRow">
                <div class="label">
                   סוג מקטע</div>
                <div class="value">
                     @Html.DropDownList("AlbumSectionTypeId", (ViewBag.AlbumSectionTypesList as SelectList), "--בחר--")</div>
            </div>
            <div class="fieldRow">
                <div class="label">
                   מס' עמודים</div>
                <div class="value">
                    <input type="number" name="PagesCount" min="2" max="100" step="2" value="${PagesCount}" /></div>
            </div>
            <div class="fieldRow">
                <div class="label">
                   סיסמת עורך המקטע</div>
                <div class="value">
                    <input type="text" name="EditorPassword" value="${EditorPassword}" /></div>
            </div>
            <div class="fieldRow">
                <div class="label">
                   אימייל עורך</div>
                <div class="value">
                    <input type="text" name="EditorEmail" /></div>
            </div>
            <div class="fieldRow">
                <div class="label">
                   שם עורך</div>
                <div class="value">
                    <input type="text" name="EditorFirstName" class="nameTextbox" />
                    <input type="text" name="EditorLastName" class="nameTextbox" />
                </div>
            </div>
            <div class="fieldRow">
                <div class="label">
                   טלפון עורך</div>
                <div class="value">
                    <input type="text" name="EditorPhone" /></div>
            </div>
            <div class="fieldRow">
                <div class="label">
                   טלפון נייד עורך</div>
                <div class="value">
                    <input type="text" name="EditorMobile" /></div>
            </div>
        </div>
        <div class="floatRight rightSpace">
            <a href="" class="button removeSection">הסר</a>
        </div>
        <div class="clear"></div>
    </li>
</script>
<script id="filmingDayRowTemplate" type="text/x-jquery-tmpl">
    <tr>
        <td>
            <input type="text" name="Date" class="dateTextbox" />
        </td>
        <td>
            @Html.DropDownList("PhotographerId", (ViewBag.Photographers as List<SelectListItem>), "--בחר--")
        </td>
        <td>
            <a href="" class="removeFilmingDay">הסר</a>
        </td>
    </tr>
</script>
